<!doctype html>
<html>
<head>
  <meta charset='utf-8'>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css">
  <link rel="stylesheet" href="../css/texmath.css">
  <script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js"></script>
  <script src="../texmath.js"></script>
  <title>test</title>
</head>
<body>
  <div id="out"></div>
  <script>
    const str = `"Euler\'s identity $e^{i\\pi}+1=0$ is a beautiful formula in $\\RR^2$."`
    document.addEventListener("DOMContentLoaded", () => {
        const md = markdownit({html:true}).use(texmath, { engine: katex,
                                                          delimiters: 'dollars',
                                                          katexOptions: { macros: {"\\RR": "\\mathbb{R}"} } });
        out.innerHTML = md.render(str);
    })
  </script>
</body>
</html>